/**
 * Created by quxiangqian on 2018/7/3.
 */
export class Option extends React.Component {

    render(){
        if(this.props.defval==this.props.value){
            this.props.selected=true;
        }else{
            this.props.selected=false;
        }
        if(this.props.selected){
            //if(!this.props.defaultinit){
                this.props.comBoxVal(this.props.value,this.props.children);

            //}

        }

        return (
            <div style={this.props.style} className={"option "+(this.props.selected===true?"selected":"")} onClick={(e)=>{
                this.props.comBoxVal(this.props.value,this.props.children)
                this.props.hide();
            }}>{this.props.children}</div>
        );
    }
}
